package ioperations;

import Book.BookList;

import java.util.Scanner;

public class Find implements Ioperation{
    @Override
    public void work(BookList bookList) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入书名：");
        String name = scanner.nextLine();
        for (int i = 0; i < bookList.Size; i++) {
            if(name.compareTo(bookList.books[i].getName()) == 0){
                System.out.println("找到这本书了：");
                System.out.println(bookList.books[i]);
                return;
            }
        }
        System.out.println("未找到这本书");
    }
}
